package com.sz.sidi.oa.intro;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;
import org.eclipse.wb.swt.ResourceManager;
import org.eclipse.wb.swt.SWTResourceManager;


public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

    public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        super(configurer);
    }

    public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
        return new ApplicationActionBarAdvisor(configurer);
    }
    
    /**
     * @wbp.parser.entryPoint
     */
    public void preWindowOpen() {
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer(); 
        Rectangle screenSize = Display.getDefault().getClientArea(); 
        configurer.setInitialSize(new Point(screenSize.width, screenSize.height));
        configurer.setShowStatusLine(true);
        configurer.setTitle("Sidi-OA");
    	configurer.setShowProgressIndicator(true);
    	configurer.setShowCoolBar(true);
    }
    
    /**
     * @wbp.parser.entryPoint
     */
    @Override
    public void createWindowContents(Shell shell) {
    	 shell.setImage(ResourceManager.getPluginImage("com.sz.sidi.oa", "icons/Login.jpg"));
    	 super.createWindowContents(shell);
    }
}
